package cn.chengpengper.fragmentUpload.service;

import cn.chengpengper.fragmentUpload.dto.ShardUploadCompleteRequest;
import cn.chengpengper.fragmentUpload.dto.ShardUploadDetailResponse;
import cn.chengpengper.fragmentUpload.dto.ShardUploadInitRequest;
import cn.chengpengper.fragmentUpload.dto.ShardUploadPartRequest;
import cn.chengpengper.fragmentUpload.entity.ShardUploadDO;
import com.baomidou.mybatisplus.extension.service.IService;

/*@formatter:off*/

/**
 * ____________________
 * < 神兽护体，永无bug! >
 * --------------------
 *
 * @author catwing
 * @version v1.0.0
 * @date 2024/12/4 22:51
 * @description 分片任务服务
 */

/*@formatter:on*/

public interface ShardUploadService extends IService<ShardUploadDO> {

    /**
     * 初始化分片上传任务
     *
     * @param request 分片上传初始化请求
     * @return 任务ID
     */
    Long initUploadTask(ShardUploadInitRequest request);

    /**
     * 上传分片文件
     *
     * @param request 分片文件上传请求
     */
    void uploadPart(ShardUploadPartRequest request);

    /**
     * 分片文件全部上传完成后的文件合并请求
     *
     * @param request 文件合并请求
     */
    void complete(ShardUploadCompleteRequest request);

    /**
     * 获取分片任务详情
     *
     * @param shardUploadId 分片任务ID
     * @return 任务详情
     */
    ShardUploadDetailResponse detail(Long shardUploadId);
}
